
#include "DTOBonus.h"

DTOBonus::DTOBonus(int type,
		int x,
		int y,
		std::string owner) : DTO(NEW_BONUS,owner){
	this->type = type;
	this->x = x;
	this->y = y;
}
DTOBonus::DTOBonus(std::string& aDeserealizar,std::string owner) : DTO(NEW_BONUS,owner){
	deserializar(aDeserealizar);
}

std::string DTOBonus::serializar(){
	std::stringstream retorno;

	retorno << UtilString::TOlenghtStringStringValue(type);
	retorno << UtilString::TOlenghtStringStringValue(x);
	retorno << UtilString::TOlenghtStringStringValue(y);

	return retorno.str();
}

void DTOBonus::deserializar(std::string& string){
	type = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
	x = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
	y = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
}

DTOBonus::~DTOBonus() {
	// TODO Auto-generated destructor stub
}


